package com.itheima.controller;

import com.itheima.framework.context.ApplicationContext;
import com.itheima.framework.context.support.ClassPathXmlApplicationContext;
import com.itheima.service.UserService;

/**
 * @author zzw
 * @date 2025/11/16
 * @description 控制层
 */
public class UserController {

    public static void main(String[] args) throws Exception {
        // 1.创建Spring容器对象
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("applicationContext.xml");
        // 2.从容器中获取userService对象
        UserService userService = applicationContext.getBean("userService", UserService.class);
        // 3.调用userService的方法进行业务逻辑处理
        userService.add();
    }
}
